package com.example.administrator.orchardeveryday.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;

import java.util.ArrayList;

/**
 * Created by Administrator on 2015/10/21 0021.
 */
public class FruitPagerAdapter extends FragmentStatePagerAdapter{
    ArrayList<Fragment> fragments;
    public FruitPagerAdapter(FragmentManager fm,ArrayList<Fragment> fragments) {
        super(fm);
        this.fragments=fragments;
    }

    @Override
    public Fragment getItem(int i) {
        return fragments.get(i);
    }

    @Override
    public int getCount() {
        return fragments==null?0:fragments.size();
    }
}
